﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using ARS.Control.Custom.DataPaging.Widget;
using NetWebControl.Models;

namespace WebTest.ControlTest
{
    public partial class DataPa : System.Web.UI.Page
    {
        //private delegate ARS.Control.DataPaging.Code.DataPaging DataPagingDelegate(DataPaging dataPaging);
        protected void Page_Load(object sender, EventArgs e)
        {

             NetWebControl.Models.Users users=new Users();
            this.DataPaging1.Entity = users;

//            this.DataPaging1.AttrDbOperat.OperatSqlListItem = new string[]
//            {
//                "Update cui_cus set CUI_NameOther='{{Text-acv}}' where Id={0}",
//                "Update cui_cus set CUI_NameOther=2 where Id={{Text-Id}}",
//                "Update cui_cus set CUI_NameOther=2 where Id={{Text-Id}}"
//            };
//
//            this.DataPaging1.AttrDbOperat.OrderListItem = new string[]
//            {
//                "Id desc",
//                "Id ASC"
//            };
//            this.DataPaging1.AttrDbOperat.SearchListItem = new string[]
//            {
//                "CUI_Name like '%{{Text-a}}%'"
//            };
//
//            GetDataPaging(this.DataPaging1);
        }
        public DataPaging GetDataPaging(DataPaging dataPaging)
        {
            //dataPaging.AttrSearchPanel
            //ARS.Control.DataPaging.Code.DataPaging dataPaging = new ARS.Control.DataPaging.Code.DataPaging();
            //ARS.Control.DataPaging.Entity.DbSelect model = this.DataPaging1.AttrDbSelect;
            dataPaging.AttrStatus.UserId = 100;
            dataPaging.AttrStatus.ClassName = System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName;
            dataPaging.AttrDbSelect.TableName = "cui_cus";

            dataPaging.AttrHtmlFanye.IsHasFanye = true;
            //dataPaging.AttrDbSelect.SearchWhere = "CUI_Name like '%{{Text-CUI_Name}}%'";
            
            
            //dataPaging.AttrDbSelect.TableName = "[Sys_Log] a,[User] b";
            //dataPaging.AttrDbSelect.SelectFields = "a.Id,a.Ip,a.LogTime,b.RealName";
            //dataPaging.AttrDbSelect.OrderField = "a.Id";
            //dataPaging.AttrDbSelect.KeyField = "a.Id";
            //dataPaging.AttrDbSelect.StrWhere = "a.USM_RLanguage=b.Id";
            //dataPaging.AttrDbSelect.SearchWhere = "a.Remark like '%{{Text-beizhu}}%' |$| a.Type='{{Text-type}}' |$| b.Id={{Text-DropDownList1}}";
            return dataPaging;
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            //this.DataPaging1.AttrDbOperat.OrderListItem = new string[]
            //{
            //    "Update cui_cus set CUI_NameOther='{{Text-UMS_RoleName}}' where Id={0}",
            //    "Update cui_cus set CUI_NameOther=2 where Id={{Text-Id}}",
            //    "Update cui_cus set CUI_NameOther=2 where Id={{Text-Id}}"
            //};


        }

    }
}